package kr.hkit.powerjava.chapter24.work1;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

import kr.hkit.powerjava.chapter24.work.vo.Student;

public class StudentDaoo implements InterDao<Student> {
	private ArrayList<Student> lists;
	private static final String FILE_NAME = "student1List.dat";

	@Override
	public void insertItem(Student item) {
		if (!lists.contains(item)) {
			lists.add(item);
		} else {
			System.out.println("중복");
		}

	}

	

	@Override
	public void deleteItem(Student item) {
		// TODO Auto-generated method stub

	}

	@Override
	public void updateItem(Student item) {
		// TODO Auto-generated method stub

	}

	@Override
	public Student searchItem(Student item) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void prnItemList(Comparator<Student> comp) {
		if (comp == null) {
			Collections.sort(lists);
		} else {
			Collections.sort(lists, comp);
		}
		for (Student std : lists) {
			System.out.println(std);
		}

	}
	

	@Override
	public void loadFile() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void saveFile() {
		// TODO Auto-generated method stub
		
	}


		
}
